//
//  Array+HKExtension.swift
//  App架构Swift
//
//  Created by 胡锦涛 on 2019/2/19.
//  Copyright © 2019 胡锦涛. All rights reserved.
//

import UIKit

// MARK: - Array-扩展
extension Array{
    
    public var hk_jsonString: String{
        
        if (!JSONSerialization.isValidJSONObject(self)) {
            HKLog("无法解析出JSONString")
            return ""
        }
        let data : Data = try! JSONSerialization.data(withJSONObject: self, options: [])
        let JSONString = String(data: data, encoding: String.Encoding.utf8)
        return JSONString!
    }
    
    
    
}
